<script>
  function htmz(frame) {
    // Write your extensions here

    // The browser automatically scrolls DOM changes into view in response to user interaction.
    // This delay prevents that, making this is the only case where we don't lean on browser defaults.
    // Remove setTimeout wrapper to allow automatic scrolling.
    setTimeout(() =>
      document
        .querySelector(frame.contentWindow.location.hash || null)
        ?.replaceWith(...frame.contentDocument.body.childNodes)
    );
  }
</script>
<iframe hidden name="htmz" onload="window.htmz(this)"></iframe>
